<?php

// Load Pinboard class
require_once 'PinboardClient.php';

// Grab the username and password
$username = strip_tags($_GET["username"]);
$password = strip_tags($_GET["password"]);

// Authenticate with Pinboard
$d = new PinboardClient;
$d->setUsername($username);
$d->setPassword($password);

$res = $d->getTags();

echo 'var delicious_tagsavail = [';
  foreach ($res as $key => $value) {
    echo '"'.$value['tag'].'",';
  }
echo '];';
?>
